import Sequelize from 'sequelize'
import db from '../util/db'


import Model from './base'

class _Model extends Model {
}


_Model.init({
    name: {
        type: Sequelize.STRING, //0 1
        allowNull: false
    },
    clientId: {
        type: Sequelize.INTEGER, //0 1
        allowNull: false
    },
    parentId: {
        type: Sequelize.INTEGER, //0 1
        allowNull: true
    },
    description: {
        type: Sequelize.STRING, //0 1
        allowNull: true
    },
    show: {
        type: Sequelize.BOOLEAN, //0 1
        allowNull: true
    },
    icon: {
        type: Sequelize.STRING, //0 1
        allowNull: true
    },
    displayOrder: {
        type: Sequelize.INTEGER, //0 1
        allowNull: true
    },
    navShow: {
        type: Sequelize.BOOLEAN,
        allowNull: true
    },
}, {
    sequelize: db,
    freezeTableName: true,
    modelName: 'categories'
    // options
});

_Model.sync({force: false})
export default _Model
